/*
 * Copyright 2016-2021 the original author.All rights reserved.
 * Kingstar(honeysoft@126.com)
 * The license,see the LICENSE file.
 */

package com.aiteasoft.school.admin.serviceimpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.teasoft.bee.osql.Condition;
import org.teasoft.bee.osql.SuidRich;
import org.teasoft.honey.osql.core.ConditionImpl;

import com.automvc.common.jq.PageWarp;
import com.automvc.common.jq.Result;

import com.aiteasoft.school.admin.entity.Course;
import com.aiteasoft.school.admin.service.CourseService;

/**
 * @author AiTeaSoft.com
 * @since  1.9
 * Create on 2021-02-07 18:18:20
 */
@Service
public class CourseServiceImpl implements CourseService {

	@Autowired
	SuidRich suidRich;

	@Override
	public Course process(Course entity) { 
		//Add the business logic if need. 放一些公共设置
		
		entity.setStatus("1");

		return entity;
	}
	
	@Override
	public boolean isWrongBizForUpdate(Result result, Course entity) {
		//Add the business logic if need.

		return false;
	}
	
/*	@Override
	public PageWarp countAndSelect(Course entity, int start, int size) {
	    Condition condition = getCondition();
	    
		int total = suidRich.count(entity, condition);
		
		condition.start(start);
		condition.size(size);
		List<Course> listPage=suidRich.select(entity, condition);
		
		return new PageWarp(total,listPage);
	}
	
	private Condition getCondition() {
		Condition condition=new ConditionImpl();
		//Add the business logic if need.
		
		return condition;
	}
*/
	@Override
	public int update(Course entity) {
		//Add the business logic if need.

//		Condition condition=new ConditionImpl();

//		return suidRich.update(entity,condition);  
		return suidRich.update(entity);
	}

}